﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WeChat.Api.Model.CreateOrder
{
    /// <summary>
    /// 支付成功后，获取的返回值中的ciphertext字段，这个就是订单信息，但是是加过密的，需要解密，解过密后就可以得到下面的实体。
    /// </summary>
    public class ReturnNotifyModel
    {
        public string mchid { get; set; }
        public string appid { get; set; }
        public string out_trade_no { get; set; }
        public string transaction_id { get; set; }
        public string trade_type { get; set; }
        public string trade_state { get; set; }
        public string trade_state_desc { get; set; }
        public string bank_type { get; set; }
        public string attach { get; set; }
        public string success_time { get; set; }
        public Payer payer { get; set; }
        public ReAmount amount { get; set; }
    }
    public class Payer
    {
        public string openid { get; set; }

    }
    public class ReAmount
    {
        public int total { get; set; }
        public int payer_total { get; set; }
        public string currency { get; set; }
        public string payer_currency { get; set; }

    }
    /// <summary>
    /// 退款成功，收到通知
    /// </summary>
    public class ReturnReFundNotifyModel
    {

        /// <summary>
        /// 退款状态，枚举值：
        /*
            SUCCESS：退款成功
            CLOSED：退款关闭
            ABNORMAL：退款异常，退款到银行发现用户的卡作废或者冻结了，导致原路退款银行卡失败，可前往【商户平台—>交易中心】，手动处理此笔退款
            示例值：SUCCESS
        */
        /// </summary>
        public string refund_status { get; set; }
        /// <summary>
        /// 退款成功时间
        /// </summary>
        public string success_time { get; set; }
        /// <summary>
        /// 微信退款单号
        /// </summary>
        public string refund_id { get; set; }
        /// <summary>
        /// 商户退款单号	
        /// </summary>
        public string out_refund_no { get; set; }
        /// <summary>
        /// 金额信息
        /// </summary>
        public refundAmount amount { get; set; }
    }
    public class refundAmount
    {
        /// <summary>
        /// 订单金额
        /// </summary>
        public int total { get; set; }
        /// <summary>
        /// 退款金额	
        /// </summary>
        public int refund { get; set; }
        /// <summary>
        /// 用户支付金额	
        /// </summary>
        public string payer_total { get; set; }
        /// <summary>
        /// 用户退款金额	
        /// </summary>
        public string payer_refund { get; set; }
    }
}
